package com.chenxy.common.exception.impl;

import com.chenxy.common.exception.BaseException;

/**
 * 公共异常枚举
 * @author chenxy
 */
public enum CommonExceptionEnum implements BaseException {
    //错误码不同的开头串可表示不同的服务模块的错误,通用参数请求错误为1开头
    UNKNOWN_ERROR(100000,"未知错误"),
    PARAMETER_VALIDATION_ERROR(100001,"参数不合法"),
    REPEAT_REQUEST_ERROR(100002,"请勿重复请求"),
    TOKEN_IS_NULL(100003,"token为空")
    ;

    private CommonExceptionEnum(int errCode, String errMsg) {
        this.errCode = errCode;
        this.errMsg = errMsg;
    }

    private int errCode;
    private String errMsg;

    public int getErrCode() {
        return this.errCode;
    }

    public String getErrMsg() {
        return this.errMsg;
    }

    public BaseException setErrMsg(String errMsg) {
        this.errMsg = errMsg;
        return this;
    }
}
